package com.yanqu.road.entity.activity.evefeast.config;

import com.yanqu.road.utils.string.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 触发配置
 */
public class EveFeastTriggerInfo {
    private int triggerType;
    private List<Integer> params = new ArrayList<>();

    private List<EveFeastEffectInfo> effectInfoList = new ArrayList<>();

    public EveFeastTriggerInfo(int triggerType, String params) {
        this.triggerType = triggerType;
        this.params = StringUtils.stringToIntegerList(params, "\\|");
    }

    public int getTriggerType() {
        return triggerType;
    }

    public List<Integer> getParams() {
        return params;
    }

    public int getParam(int index){
        if (index < 0 || params.size() <= index) {
            return 0;
        }
        return params.get(index);
    }

    public List<EveFeastEffectInfo> getEffectInfoList() {
        return effectInfoList;
    }

    public void setEffectInfoList(List<EveFeastEffectInfo> effectInfoList) {
        this.effectInfoList = effectInfoList;
    }
}
